using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class SO_UNLINKEDPAYMap : EntityTypeConfiguration<SO_UNLINKEDPAY>
    {
        public SO_UNLINKEDPAYMap()
        {
            // Primary Key
            this.HasKey(t => new { t.Date, t.Amount });

            // Properties
            this.Property(t => t.Number)
                .HasMaxLength(6);

            this.Property(t => t.Patient)
                .HasMaxLength(40);

            this.Property(t => t.Patient__)
                .HasMaxLength(6);

            this.Property(t => t.Document_Type)
                .HasMaxLength(7);

            this.Property(t => t.Created_By)
                .HasMaxLength(30);

            // Table & Column Mappings
            this.ToTable("SO_UNLINKEDPAY");
            this.Property(t => t.Number).HasColumnName("Number");
            this.Property(t => t.Patient).HasColumnName("Patient");
            this.Property(t => t.Patient__).HasColumnName("Patient_#");
            this.Property(t => t.Document_Type).HasColumnName("Document_Type");
            this.Property(t => t.Date).HasColumnName("Date");
            this.Property(t => t.Amount).HasColumnName("Amount");
            this.Property(t => t.Created_By).HasColumnName("Created_By");
        }
    }
}
